package com.itheima.controller;

import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * CTassName: BookController
 * Package: com.itheima.controller
 * Description:
 *
 * @Author xw
 * @Create 2023/11/10 12:16
 * @Version 1.0
 */

@Scope("prototype")
//@Lazy  // 延迟初始化（延迟到初始化的时候）
@RestController

public class BookController {

    public BookController(){
        System.out.println("--------> 重生之我在黑马学java");
    }

    @RequestMapping("/books")
    public String list() {
        String bookanem = "重生之我在黑马学java";
        System.out.println(bookanem);
        return bookanem;
    }
}
